Skip to content

fix: copy 3D model source links and web extension parts when extracting slides - #566

Merged
sergey-tihon merged 3 commits into
sergey-tihon:masterfrom
NikiforovAll:fix/slide-dropped-relationships
Nov 26, 2026
Merged

sergey-tihon merged 3 commits into
sergey-tihon:masterfrom
NikiforovAll:fix/slide-dropped-relationships

Conversation

@NikiforovAll

Copy link
Copy Markdown
Contributor

Problem

Follow-up to #563. When a slide is extracted, two kinds of relationship are not copied. The new slide keeps an r:id that points to nothing, so the output is invalid and some consumers cannot render it.

  • am3d:attrSrcUrl r:id inside am3d:model3d is the hyperlink to the source of a 3D model. fix: copy 3D model parts when extracting slides #563 copies the .glb part and the raster preview, but not this hyperlink.
  • we:webextensionref r:id inside a:graphicData points to a web extension part (an Office add-in on the slide). There is no handler for it, so the part and its snapshot image are not copied.

Fix

  • AddRelationships handles am3d:attrSrcUrl the same way as a:hlinkClick: it copies the hyperlink relationship and rewrites the id.
  • CopyRelatedPartsForContentParts copies the web extension part for we:webextensionref and rewrites the id. It then runs the usual relationship copy on the new part, so the we:snapshot r:embed image is copied too. This is the same pattern that the diagram parts use, and it matches DocumentBuilder, which keeps web extensions for Word.
  • Only slide parts can own a web extension part, so the copy applies to slides only.

Tests

  • PB011_SlideWith3DModelSourceUrl: adds am3d:attrSrcUrl and a hyperlink relationship to the PB008-3DModel.pptx slide in memory, extracts the slide, and checks that the id resolves to the same external URL.
  • PB012_SlideWithWebExtension: adds a web extension part with a snapshot image to a slide in memory, extracts the slide, and checks the part, its XML and the snapshot image.
  • Both tests run Validate, which includes RelationshipValidator. Both fail without the fix with a "not registered on this part" error.
  • No new test files.

…ng slides

A slide with am3d:attrSrcUrl or we:webextensionref keeps a relationship id that points to nothing, because the hyperlink relationship and the web extension part (with its snapshot image) are not copied.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The regression test incorrectly validates Office 2013 markup against Office 2007 schemas, and linked web-extension snapshots still retain dangling relationship references.

2 open issues
What changed in this PR

This PR extends PowerPoint slide extraction to preserve 3D model source hyperlinks and web extension parts, addressing relationship-copying gaps left after #563.

Changes:

  • Copies and rewrites 3D model source hyperlink relationships.
  • Copies slide web extensions and their embedded snapshot images.
  • Adds regression tests using existing presentation fixtures.
File Description
Clippit/​PtOpenXmlUtil.cs Adds the 3D model source URL XML name.
Clippit/​PowerPoint/​Fluent/​PresentationBuilderTools.cs Handles 3D model source hyperlinks during relationship copying.
Clippit/​PowerPoint/​Fluent/​FluentPresentationBuilder.Copy.cs Copies web extension parts and embedded snapshots.
Clippit.Tests/​PowerPoint/​PresentationBuilderTests.cs Adds source-link and web-extension extraction tests.

Review effort: Balanced

sergey-tihon and others added 2 commits November 26, 2026 21:18
Update validation to use Office 2013 file format version.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the slide-extraction changes preserving 3D model source hyperlinks and Office web extension parts.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@sergey-tihon
sergey-tihon merged commit 089e54b into sergey-tihon:master Nov 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants